package com.mogu.comment.constraint;

import com.mogu.comment.annotion.BooleanNotNull;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * Description:不在能知，而在能行
 *
 * @author: 梁西华
 * @date: 2020/6/11/10:41
 **/

public class BooleanValidator implements ConstraintValidator<BooleanNotNull,Boolean> {

    @Override
    public void initialize(BooleanNotNull constraintAnnotation) {

    }

    @Override
    public boolean isValid(Boolean value, ConstraintValidatorContext context) {
        if (value == null){
            return false;
        }
        return true;
    }
}
